<template>
  <el-container>
    <el-header>
      <el-menu mode="horizontal" :default-active="activePage">
        <el-menu-item index="home" @click="goToHome">首页</el-menu-item>
        <el-menu-item index="restaurant" @click="goToRestaurant">餐厅</el-menu-item>
        <el-menu-item index="user" @click="goToUser">用户信息</el-menu-item>
      </el-menu>
    </el-header>

    <el-main>
      <router-view />
    </el-main>
  </el-container>
</template>

<script>
export default {
  name: 'App',
  data() {
    return {
      activePage: 'home',
    }
  },
  methods: {
    goToHome() {
      this.$router.push({ name: 'home' });
    },
    goToRestaurant() {
      this.$router.push({ name: 'restaurant' });
    },
    goToUser() {
      this.$router.push({ name: 'user' });
    },
  },
};
</script>

<style>
/* Add your custom global styles here */
</style>
